package com.zhousb.deviceManager.model.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author ZhouShenBin
 * @date 2024/7/11 10:58
 * @description
 */
@Getter
@AllArgsConstructor
public enum NoticeStatusEnum {
    DEFAULT(-1,"未知"),
    CREATED(0,"未读"),
    READ(1,"已读");

    private final Integer code;
    private final String name;

    public static NoticeStatusEnum getInstance(Integer code){
        for (NoticeStatusEnum _enum : NoticeStatusEnum.values()) {
            if (_enum.getCode().equals(code)){
                return _enum;
            }
        }
        return DEFAULT;
    }
}
